﻿@using Newtouch.Infrastructure;
@using Newtouch.HIS.Web.Core.Extensions;
@{
    /**/
    ViewBag.Title = "YPInOutBound";
    Layout = "~/Views/Shared/_Form.cshtml";
    //报表链接
    //var reportUrl = SysConfigReader.OrgReportLink();
    var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl");
    var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode");
    var djlxItemStrs = "1,2,3,4,5,6"; //对应枚举EnumDanJuLX
}

<div class="rows">
    <div class="panel panel-default">
        <table class="form">
            <tr>
                <th class="formTitle">源仓库</th>
                <td class="formValue">
                    <select id="rck" name="rck" class="form-control required"></select>
                </td>
                <th class="formTitle">库存动作：</th>
                <td class="formValue">
                    @Html.DropDownList("djlx", EnumDanJuLX.yaopinruku.ToSomeDescSelectList(djlxItemStrs), "全部", new { @class = "form-control" })
                </td>
                <th class="formTitle">开始日期：</th>
                <td class="formValue">
                    <input id="kssj" type="text" class="form-control input-wdatepicker form-an" style="width: 130px;"
                           onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss'})" value="@(DateTime.Now.ToString("yyyy-MM-01 00:00:00"))" />
                </td>
                <th class="formTitle" style="padding-right:5px;">结束日期：</th>
                <td class="formValue">
                    <input id="jssj" type="text" class="form-control input-wdatepicker form-an" style="width:130px"
                           onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" value="@(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"))" />
                </td>
                <th class="formTitle"></th>
                <td class="formValue" style="padding-left:20px;">
                    <input type="button" id="btn_search" onclick="submit();" class="btn btn-primary btn-md" value="查询" style="width:55px" />
                </td>
            </tr>
        </table>
    </div>
    <input type="text" id="zxys" hidden="hidden" />
</div>

<div class="ui-layout" id="layout" style="height:100%;width:100%;">
    <iframe class="ui-layout-center" style="width:100%;" id="iframerightiframerightiframerightttt" name="iframerightiframerightiframerightttt"
            scrolling="auto" allowtransparency="true" frameborder="0"></iframe>
</div>

<script type="text/javascript">
    $("#rck").bindSelect({
        url: "/Dictionaries/GetYFYKCodeSelectJson",
        param: {},
        dataType: "json",
    });
    function submit() {
        if ($('#kssj').val().length == 0) {
            $.modalAlert("缺少开始时间", "error");
            return;
        }
        if ($('#jssj').val().length == 0) {
            $.modalAlert("缺少结束时间", "error");
            return;
        }
        if ($('#kssj').val() > $('#jssj').val()) {
            $.modalAlert("开始时间不能大于结束时间", "error");
            return;
        }
        var yfcode = "@Newtouch.Infrastructure.Constants.CurrentYfbm.yfbmCode";
        var uri = '@reportUrl' + "?tempCode=1018" + "&systemCode=" + '@reportSystemCode' + "&orgId=" + '@ViewBag.OrganizeId';
        uri += "&kssj=" + $('#kssj').val() + "&jssj=" + $('#jssj').val() + "&djlx=" + $("#djlx").val() + "&rck=" + $("#rck").val();
        setTimeout("$.loading(true, '正在请求报表页面...');", 10);
        $("#iframerightiframerightiframerightttt").attr('src', uri);
    }

    $("#iframerightiframerightiframerightttt").load(function () {
        $.loading(false);
    });

    $(function () {
        var h = $(window).height() - 55
        $('#layout iframe').css('height', h);
        init();
    });

    //刷新列表
    function refReport() {
        $("#btn_search").trigger('click');
    }

</script>
